1. Field of the Invention
This invention relates to an electronic musical instrument which is provided with a key code generator of a variable frame which provides for a shortened time for scanning key switches to detect closed ones of them.
2. Description of the Prior Art
In a device which has a large number of key switches, such as the keyboard of an electronic musical instrument, direct connection of the key switches to internal circuits for transferring information on the opening and closure of the switches to a desired one or ones of the circuits inevitably involves an enormous amount of wiring, and hence is uneconomical. Also, the use of semiconductor integrated circuits or the like is difficult because of too large a number of pins.
In view of the above, there has recently been proposed a system which scans all key switches in a predetermined period of time and generates a pulse at the moment corresponding to a closed one of the key switches for each time sequence of the scanning, thereby to save connections between the key switches and required circuits. For example, a key code multiplex system is usually employed in which information of a closed key switch detected by scanning the key switches on a time sharing basis is sent in the form of a TDM (Time Division Modulation) or PCM (Pulse Code Modulation) signal. With this system, however, the time for scanning all the key switches is fixed and this fixed scanning time is always required regardless of the number of key switches being closed, so that the scanning time is consumed wastefully in somes cases.
The maximum number of keys which can be depressed simultaneously with both hands and a foot in the playing of an ordinary keyboard instrument is eleven. Assuming that blocks into which the keys are divided each correspond to one octave, it is impossible to depress the keys of more than two octaves with one hand, and accordingly the maximum number of blocks simultaneously occupied is five. Accordingly, it is possible to employ such a method in which the key switches are scanned for each block of them and if a key switch or switches are closed, the scanning is stopped for the detection of them. Since the scanning is not stopped in the block in which no key switches are closed, one scanning time for obtaining information of closed key switches can be shortened.